package com.Algorithm.HUAWEI.two20220303;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2022/03/10/15:40
 * @Description:
 * @Target:
 */
public class 删除字符串中出现次数最少的字符 {
    //    aabcddd
    //    aaddd
    public static void main(String[] args) throws IOException {
        // 数组，英文26
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        int[] ints = new int[26];
        String s = bufferedReader.readLine();
        int min = Integer.MAX_VALUE;
        HashSet set = new HashSet();
        StringBuffer stringBuffer = new StringBuffer();

        for (int i = 0; i < s.length(); i++) {
            ints[s.charAt(i)-'a']++;

        }

        for (int anInt : ints) {
            if (anInt!=0 && min > anInt){
                min =  anInt;
            }
        }

        for (int i = 0; i < ints.length; i++) {
            if (min==ints[i]){
                set.add(((char)(i+'a')));

            }
        }


        for (int i = 0; i < s.length(); i++) {
            if (set.contains(s.charAt(i))){

            }else {
                stringBuffer.append(s.charAt(i));
            }

        }



        System.out.println(stringBuffer.toString());


    }
}
